local lueying = fk.CreateSkill({
  name = "mini_mou__lueying",
})

Fk:loadTranslationTable{
  ["mini_mou__lueying"] = "掠影",
  [":mini_mou__lueying"] = "当你使用【杀】指定一个目标后，你获得一个“椎”标记。<br>"..
  "当你使用【杀】结算结束后，若你拥有至少两个“椎”标记，则你移去两个“椎”标记，摸一张牌，然后可以视为使用一张【过河拆桥】。",

  ["@mini_mou__lueying_hit"] = "椎",
  ["#mini_mou__lueying-use"] = "掠影：你可以视为使用【过河拆桥】",

  ["$mini_mou__lueying1"] = "我习武多年，身法可不是白练！",
  ["$mini_mou__lueying2"] = "身轻如燕，走壁飞檐！",
}

lueying:addEffect(fk.TargetSpecified, {
  mute = true,
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(lueying.name) and
      data.card.trueName == "slash"
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    player.room:addPlayerMark(player, "@mini_mou__lueying_hit")
  end,
})

lueying:addEffect(fk.CardUseFinished, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(lueying.name) and
      data.card.trueName == "slash" and player:getMark("@mini_mou__lueying_hit") > 1
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:removePlayerMark(player, "@mini_mou__lueying_hit", 2)
    player:drawCards(1, lueying.name)
    if player.dead then return end
    room:askToUseVirtualCard(player, {
      name = "dismantlement",
      skill_name = lueying.name,
      prompt = "#mini_mou__lueying-use",
      cancelable = true,
    })
  end,
})

lueying:addLoseEffect(function (self, player)
  player.room:setPlayerMark(player, "@mini_mou__lueying_hit", 0)
end)

return lueying
